import { createI18n } from 'vue-i18n';
import lang from './lang/index.js';

export const languages = [
	{id: 'zh-CN', name: '简体中文', icon: '/images/lang/zh-CN.png'},
	{id: 'en', name: 'English', icon: '/images/lang/en.png'},
	{id: 'korean', name: '한국어', icon: '/images/lang/korean.png'},
	{id: 'russian', name: 'Русский язык', icon: '/images/lang/russian.png'},
	// {id: 'japanese', name: '日本語', icon: '/images/lang/japanese.png'},
]

const i18n =  createI18n({
	legacy: false, // you must specify 'legacy: false' option
	locale: uni.getStorageSync('lang') || 'zh-CN',
	globalInjection: true, //全局生效$t
	messages: lang
})

export default i18n